﻿<?php
	@session_start();
	include("../../connect/connect_mysql.php");
	$act= $_POST['act'];

	if ($act== 'delete_logo'){
		$page_id = $_POST['page_id'];
		$ids = $_POST['ids'];
		$query = "UPDATE `logo` SET `is_deleted`= '1' WHERE page_id = $page_id and logo_id IN ($ids);";
		mysql_query ("SET NAMES 'utf8'");
		mysql_query($query);
		echo 1;
	}
	
	if($act== 'select_logo'){
		$ids = $_POST['ids'];
		$ids= chop($ids,",");
		
		$page_id = $_POST['page_id'];
		mysql_query ("SET NAMES 'utf8'");
		mysql_query("UPDATE `logo` SET `flag`= '0' WHERE flag = '1' and page_id = '$page_id' and logo_id NOT IN ($ids);");
		mysql_query ("SET NAMES 'utf8'");
		mysql_query("UPDATE `logo` SET `flag`= '1' WHERE flag = '0' and page_id = '$page_id' and logo_id IN ($ids);");
						
		echo 1;
	}
?>
	